import { _decorator, Component, Node,RigidBody2D } from 'cc';
import { BlockType } from '../Common';
const { ccclass, property } = _decorator;

@ccclass('Block')
export class Block extends Component {

   @property bType:BlockType=0;


   getBlockType():BlockType{
     return this.bType;
   }

   protected start(): void {
      
   }

   destorySelf(){
    this.scheduleOnce(()=>{
      this.node.active=false;
      let rb2d=this.node.getComponent(RigidBody2D);
      if(rb2d){
        rb2d.enabled=true;
      }

      this.node.destroy();
  },0.05);
   }
}


